package com.think.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.think.entity.Station;
import com.think.mapper.StationMapper;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@Validated
@RequestMapping("/laction/")
@Api(tags = "接口")
public class LocationController {
    @Autowired
    private StationMapper stationMapper;

    @GetMapping("/page")
    public IPage<Station> page(final Page p) {
        final QueryWrapper<Station> wrapper = new QueryWrapper();
        wrapper.ge("id", 0);
        return this.stationMapper.selectPage(p, wrapper);
    }
}
